cmake_minimum_required(VERSION 3.16)
project(DXGICapture)

set(CMAKE_CXX_STANDARD 14)
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /source-charset:utf-8 /execution-charset:gbk")
    #    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /source-charset:utf-8 /execution-charset:gbk")
endif()
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
set(OpenCV_DIR E:/opencv/opencv-4.5.5/cmake-build-release-visual-studio)
find_package(OpenCV REQUIRED)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(DXGICapture main.cpp)


# 指定C++ 异常处理程序try()catch的展开语义
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/EHsc")
target_link_libraries(DXGICapture ${TORCH_LIBRARIES} ${OpenCV_LIBS})

